﻿using System.Reflection;

namespace Basmus.Values
{
    public class PropertyInfoGetterSetter : IGetterSetter
    {
        private readonly PropertyInfo _propertyInfo;

        public PropertyInfoGetterSetter(PropertyInfo propertyInfo)
        {
            _propertyInfo = propertyInfo;
        }

        public object Get(object target)
        {
            return _propertyInfo.GetValue(target, null);
        }

        public void Set(object target, object value)
        {
            _propertyInfo.SetValue(target, value, null);
        }
    }
}